package com.grgbanking.it.project.service;

import java.util.List;

import org.apache.poi.hssf.usermodel.HSSFWorkbook;

import com.grgbanking.it.base.IAlterService;
import com.grgbanking.it.base.ISearchOneJSONService;
import com.grgbanking.it.base.IWXConnectionService;
import com.grgbanking.it.common.entity.PageQuery;
import com.grgbanking.it.project.entity.OperationWork;
import com.grgbanking.it.project.entity.OperationWorkHandle;
import com.grgbanking.it.system.entity.User;
import com.grgbanking.it.wx.entity.WXVerify;

/**
 * 运维工作
 * 
 * IOperationWorkService
 * 
 * @author 潘广伟
 * @Email p_3er@qq.com
 * @Date 2015-1-7 下午5:41:27
 * 
 * @version 1.0.0
 *
 */
public interface IOperationWorkService extends IWXConnectionService,IAlterService<OperationWork>,ISearchOneJSONService<Integer>{
	public String findByPageToJson(PageQuery query,OperationWork operationWork,User user) throws Exception;
	public void delete(User user,Integer id) throws Exception;
	/**
	 * 分配工作
	 * @param workId
	 * @param handlerJson
	 */
	public void updateForDistribute(Integer workId,String handlerJson) throws Exception;
	/**
	 * 分配工作
	 * updateForDistribute
	 * 
	 * @param workId
	 * @param engineers
	 * @throws Exception 
	 * @exception 
	 * @since  1.0.0
	 */
	public void updateForDistribute(Integer workId,String[] engineers) throws Exception;
	/**
	 * 处理工作
	 * @param workId
	 * @param describe TODO
	 * @param handle
	 * @param handler
	 * @throws Exception
	 */
	public void updateForHandle(Integer workId,String describe,OperationWorkHandle handle, User handler) throws Exception;
	/**
	 * 工作的处理明细表
	 * @param workId
	 * @return
	 * @throws Exception
	 */
	public String findHandleToJson(Integer workId) throws Exception;
	/**
	 * 获取简单的统计数据
	 * @param user
	 * @return
	 * @throws Exception
	 */
	public String getSimpleStatistics(User user) throws Exception;
	/**
	 * 根据ID获取工作
	 * findWorkById
	 * 
	 * @param id
	 * @return 
	 * @exception 
	 * @since  1.0.0
	 */
	public OperationWork findWorkById(Integer id);
	/**
	 * 根据用户为最新处理完的工作进行评价
	 * updateWhenFeedback
	 * 
	 * @param username
	 * @param feedbackGrade 
	 * @exception 
	 * @since  1.0.0
	 */
	public OperationWork updateWhenFeedback(String username,Integer feedbackGrade);
	/**
	 * 获取回复的信息
	 * getMessageWhenRecived
	 * 
	 * @param username
	 * @param type  1工作创建时,2工作评价成功,3工作评价失败
	 * @return
	 * @throws Exception 
	 * @exception 
	 * @since  1.0.0
	 */
	public String getMessageWhenRecived(String username,WXVerify verify,Integer type) throws Exception;
	/**
	 * 下拉加载分页数据
	 * findWhenLoad
	 * 
	 * @param user
	 * @param page
	 * @param pageSize
	 * @param state
	 * @param type 
	 * @return 
	 * @exception 
	 * @since  1.0.0
	 */
	public String findWhenLoad(User user, Integer page, Integer pageSize,Integer state, Integer type);
	/**
	 * 获取处理过程
	 * findWorkHandles
	 * 
	 * @param workId
	 * @return 
	 * @exception 
	 * @since  1.0.0
	 */
	public List<OperationWorkHandle> findWorkHandles(Integer workId);
	/**
	 * 导出数据
	 * getExtportBook
	 * 
	 * @param operationWork
	 * @param user
	 * @param exportParams
	 * @return
	 * @throws Exception 
	 * @exception 
	 * @since  1.0.0
	 */
	public HSSFWorkbook getExtportBook(OperationWork operationWork,User user,String exportParams)
			throws Exception ;
	
}